package com.vitas.coin.ui.act

import android.view.View
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.blankj.utilcode.util.BarUtils
import com.snap.common.main.BaseMVVMAct
import com.snap.util.edge.marginTopSystemWindowInsets
import com.snap.util.edge.paddingBottomSystemWindowInsets
import com.vitas.coin.R
import com.vitas.coin.databinding.ActChooseMusicLocalBinding
import com.vitas.coin.util.AdUtil
import com.vitas.coin.vm.LocalMusicVM


class ChooseLocalMusicListAct : BaseMVVMAct<ActChooseMusicLocalBinding, LocalMusicVM>(){

    override fun createVM(): LocalMusicVM {
        return LocalMusicVM().apply {
            actionAct = { this@ChooseLocalMusicListAct }
        }
    }

    override fun doDataBind() {
        binding.viewModel = viewModel
        binding.page = this
    }

    override fun getContentViewId(): Int {
        return R.layout.act_choose_music_local
    }

    override fun onCreate() {
        binding.clContent.paddingBottomSystemWindowInsets()
        binding.rlTop.marginTopSystemWindowInsets()
        //BarUtils.addMarginTopEqualStatusBarHeight(binding.rlTop)
        BarUtils.transparentStatusBar(this)
        BarUtils.setStatusBarLightMode(this, true)
        initRv()
        initObserve()
        viewModel.loadData()
    }


    private fun initObserve() {

    }

    private fun initRv() {
        binding.mRecyclerView.layoutManager = LinearLayoutManager(this, RecyclerView.VERTICAL, false)
        binding.mRecyclerView.adapter = viewModel.musicAdapter
    }

    fun onClickBack(view: View) {
        finish()
    }




}